The 2nd one. With have /has/had (perfect tenses) we use, generally, 3rd form of verb in a sentence unless you're using it as a verb. But here inthis case HAD BETTER IS A MODAL VERB SO WE USE THE 1ST FORM. If you're using it as an adverb or noun or an adjective, then the case would become different.