It still caused scrollbars to appear, so I tried to change Marc's approach - now window's scrollbars should be inactive, only dialog's content should have them [1]. While at it, I also upgraded jQuery UI to the newest stable version [2].
I hope I didn't break anything in the process, and that new dialog works better.
[1] http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/phpmyadmin... [2] http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/phpmyadmin...