Fix Terminal.app resizing (@juniorz, thx for mutex idea)