Femtoscopic scales in p+p and p+Pb collisions in view of the uncertainty principle