Anne Hathaway vowed to stop drinking until her son turns 18 because she knows her time with him is "precious".