Mess with maxlength only if specified

It seems the previous patch was causing problems in Firefox 3.6 since it
was returning -1 for the value of the maxlength attribute if the
attribute was never supplied in the first place.

This patch tries to detect if the maxlength was supplied, and only
proceeds to manipulate it if it is present.

**Note**: Unfortunately, I had no time to test this change in an actual browser. Please, please, test it in IE8 and Firefox 3.6 before merging. Thanks and sorry for the extra work.