Hi,

I fixed this a few weeks ago. It was caused by inputs events arriving before the init code had finished. When the system was heavily loaded, when memory was low, when the a disk needed to spin up etc. this became more prominent.

This was fixed by block input in the init function, see http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=0392e241b844487261d4dfcccc9a442793e0a868 for details.

Sincerely,
    Anders Lindgren