You can lock sneakign when spamming 2 keys
Whilst being in gamemode 1 you can spam "jump" and "sneak" and eventually after releasing the sneak button you will still sneak.
Easier way to do: Doubletap space like you want to get into fly mode, and simultaneously the sneak key. After releasing you'll be locked into sneaking. May be related to https://bugs.mojang.com/browse/MCPE-13619?filter=-3 ?