There are multiple places where double buffer is used in controlers
code. This commit adds generic implementation of the double buffer.
It can be used in future in all places where the data structure is
in use.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>