emacs: Cleanup mock gnu screen function

Minor cleanup of the function while passing term numbering information
to shell process that can use it to update PS1 prompt