On the completeness of gradient Ricci solitons