[ticket/11946] Fix textarea auto-resize code

Fixes few issues with code that automatically resizes textarea elements.
http://tracker.phpbb.com/browse/PHPBB3-11946