@György-Farkas Well I have tried pull down resistors, but the problem is that those pins aren't floating from the beginning, as probably the internal multiplexer does something before loading the kernel. As shown on logic analyser graph pins actually go high for around 7 sec and have 1us pulses every 25us or so, which are then detected by 74hc595. DPIO 11 doesn't have those pulses, but stays high (output state) till you don't run a scriptwhere you set the output to low on other side others - 17, 16, 15 go to floating state after that.
I then decided I will go with i2c port expander for more safe and predictable operation. MCP23008 is quiet handy as they are used in relay dock and have libraries written for it.