Configure dtim_period dynamicly

Before dtim period was hardcoded to 2. Change it dynamically
based on AP configuration.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Fix build after cleanup

Patch a0e6bc39479c78e7ed3dbd2a384bde52d5be65b0 broke
build.

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>