Fix: Header now only gets pinned/unpinned if it is unpinned/pinned

When you load your document and slowly scroll down some 30px or so and scroll back up, the header gets pinned though it is already pinned/never got unpinned. Fixed this with an additional if-statement in the pin / unpin functions. Not sure if this is the right place or if it has to be fixed within the update function…?