resize pty after starting

Since ptyMaster is created during container start (startPty), it should
resized after starting, not before.

This fixes #2377.